home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Magazine / Online / HLHandler110 / Installer < prev    next >
Text File  |  1997-03-30  |  7KB  |  216 lines

  1.  
  2. ;----------------------------------------------------------------------------
  3. ;
  4. ; HotListHandler Installer script by Robert Nienkemper <robertn@tip.nl>
  5. ;
  6. ;----------------------------------------------------------------------------
  7. ;
  8. ; $VER: Installer script 1.10 for HotListHandler © Robert Nienkemper
  9. ;----------------------------------------------------------------------------
  10. ;
  11. ; Setting up
  12. ;
  13.  
  14. (set version1 (getversion "HotListHandler")) (set version2 (/ version1 65536)) 
  15. (set revision1 (- version1 (* version2 65536) ) ) (set HLHversion (cat version2 "." revision1))
  16.  
  17. (set @source-dir (pathonly @icon) )
  18. (set firsttime 0)
  19. (set keyfound 0)
  20.  
  21. (foreach @source-dir "#?.key"(set keyfound 1))
  22. (set #about (cat "\n\nWelcome to\n\nHotListHandler " HLHversion "\nCopyright © 1996-1997 by Robert Nienkemper\n\n"
  23.      (if (= keyfound 1)
  24.        (cat "Thank you for registering HotListHandler!")
  25.        (cat "Please refer to the documentation for information on restrictions and instructions about registration.")
  26.      )
  27.      ( "\n\nThis program will install all necessary files on your system. This program will NOT change any old settings!"))
  28. )
  29. (set #HLH_dir "Where would you like to install HotListHandler?.\n(NO extra drawer will be created!)")
  30. (set #HLHdir_help "\nHotListHandler will be copied to the directory you have selected.\n")
  31. (set #HLHdir_help1 "\nDon't worry about the tooltypes you have set in older versions.\n")
  32. (set #HLHdir_help2 "\nThis installer script will notice if you are upgrading and therefore")
  33. (set #HLHdir_help3 " will not overwrite your HotListHandler.info file.") 
  34. (set #HLH_script "\nDo you want to run the AddToHotlist clean-up script?\n")
  35. (set #HLHscript_help "\nIf you have used, or are still using, my \"AddToHotlist.aweb\" script, ")
  36. (set #HLHscript_help1 "this script will remove the index and any HTML codes from the hotlist created by \"AddToHotlist.aweb\".")
  37. (set #wherehotlist "\nSelect the directory where your aweb.hotlist is stored.\n")
  38. (set #wherehotlist_help  (cat "\nHLH needs to know where you keep your hotlist.\n"
  39.             "\nThis program will set the tooltype 'HOTLIST' for you.\n"
  40.             "\nIf HLH cannot find a hotlist upon startup, HLH will create one.\n\n"
  41.             "\nNOTE: HLH also uses this path for 'cleaning-up' if you have been " 
  42.             "using \"AddToHotList.aweb\"."))
  43. (set #ttype_help (cat "\nThis program uses the selected directory to find AWeb's hotlist.\n"
  44.             "It will remove all HTML codes that 'AddToHotlist.aweb' has added"))
  45. (set #hotprompt "\nCleaning up your Hotlist now!")
  46. (set #HLHguide_dir "\nWhere would you like to install the HotListHandler.guide?")
  47. (set #HLHguide_help "\nThe HotListHandler.guide will be copied to the selected directory.")
  48. (set #HLHtool "\nShould I set the ToolTypes for you?\n")
  49. (set #HLHtool_help (cat "\nHLH supports, at the moment, two tooltypes/arguments.\n"
  50.             "\nThis program will set the HotList location.\n"
  51.             "\nThe PubScreen must be set manually.\n"
  52.             "\n\nPlease refer to the HotListHandler.guide for more information."
  53.             ))
  54. (set #nohotlist1 "\n\nHLH can't clean up your hotlist!\n\n\n")
  55. (set #nohotlist2 "\n\nHotlist not found!")
  56. (set #done1  "\n\nClick the HotListHandler icon in the\n")
  57. (set #done2  "\ndirectory to start.\n\nHave fun...")
  58.  
  59. (set #wrongOS "\nHotListHandler requires OS 3.0 or later to function.")
  60.  
  61. ;----------------------------------------------------------------------------
  62. ; Say hello
  63.  
  64. (message #about)
  65. (welcome)
  66.  
  67. ;----------------------------------------------------------------------------
  68.  
  69. ; Checking environment
  70.  
  71. (set OS_ver (getversion "exec.library" (resident)))
  72. (if (< OS_ver (* 39 65536)) (abort #wrongOS))
  73.  
  74.  
  75. ;----------------------------------------------------------------------------
  76. ;
  77. ; Let's do it...
  78.  
  79. (complete 0)
  80.  
  81. (set @default-dest @source-dir)
  82.  
  83. (set hotdir "")
  84.  
  85.  
  86. (set HLHandler_dir
  87.         (askdir
  88.                 (default @default-dest)
  89.                 (prompt  #HLH_dir)
  90.                 (help    (cat #HLHdir_help #HLHdir_help1 #HLHdir_help2 #HLHdir_help3))
  91.  
  92.         )
  93. )
  94.  
  95. (set @default-dest HLHandler_dir)
  96.  
  97.  
  98. (if (exists (tackon HLHandler_dir "HotListHandler"))
  99.   (set firsttime 1))
  100.  
  101. (set stopcopy (= @source-dir @default-dest))
  102.  
  103. (if (not stopcopy)
  104.  ( 
  105.  
  106.    (copyfiles (source  "HotListHandler" )
  107.                    (dest HLHandler_dir)
  108.    )
  109.  
  110.    (complete 16)
  111.  
  112.    (if (= firsttime 0)
  113.        (copyfiles ( source  "HotListHandler.info")
  114.                         (dest HLHandler_dir)
  115.        ) 
  116.    )
  117.  )
  118. )
  119.  
  120.    (complete 32)
  121.  
  122.  
  123.    (set dotypes (askchoice (choices "Set Tooltypes" "Do not set Tooltypes")
  124.               (prompt #HLHtool)
  125.                       (help  #HLHtool_help )
  126.                   (default 0)
  127.             )
  128.    )
  129.  
  130.    (if (= dotypes 0)
  131.     (
  132.      (set hotdir (askdir (prompt #wherehotlist)
  133.                  (help   #wherehotlist_help)
  134.                       (default HLHandler_dir)
  135.                  )  
  136.      )
  137.  
  138.  
  139.     (if (not (= hotdir ""))
  140.      (
  141.     (tooltype (prompt "Setting tooltypes...")
  142.               (dest (tackon HLHandler_dir "HotListHandler"))
  143.               (settooltype "HOTLIST" (tackon hotdir "aweb.hotlist"))
  144.     ) 
  145.      )
  146.    )
  147.   )
  148.   )
  149.  
  150.    (set guidedir (askdir (prompt #HLHguide_dir)
  151.                          (help   #HLHguide_help)
  152.                          (default HLHandler_dir)
  153.                 )  
  154.    )
  155.  
  156. (set stopcopy (= @source-dir guidedir))
  157.  
  158. (if (not stopcopy)
  159.  (
  160.    (copyfiles ( source  "HotListHandler.guide" )
  161.                            (dest guidedir)
  162.                            (infos)
  163.    )
  164.  )
  165. )
  166.  
  167.    (complete 64)
  168.  
  169.    (if (= keyfound 1)
  170.     (foreach @source-dir "#?.key"
  171.      (
  172.        (copyfiles (source @each-name)
  173.                   (dest "SYS:L")
  174.                   (newname "HLHandler.key")
  175.                   (prompt "Installing your personal keyfile")
  176.        )
  177.      )
  178.     )
  179.    )
  180.  
  181.  
  182.    (complete 92)
  183.  
  184.    (set cleanup (askchoice (choices "Please clean up my hotlist" "Do not clean up my hotlist")
  185.               (prompt #HLH_script)
  186.                       (help (cat #HLHscript_help #HLHscript_help1))
  187.                   (default 0)
  188.             )
  189.    )
  190.  
  191.    (if (= cleanup 0)
  192.     (
  193.      (if (= hotdir "")
  194.       (set hotdir (askdir (prompt #wherehotlist)
  195.                   (help   #ttype_help)
  196.                        (default HLHandler_dir)
  197.                   )  
  198.       )
  199.      )
  200.     (set hotfile (tackon hotdir "aweb.hotlist"))
  201.     (if (not (exists(hotfile)))(message (cat #nohotlist1 "\""hotfile"\"" #nohotlist2))
  202.      (
  203.       (working (#hotprompt))
  204.       (run (cat "SYS:Rexxc/rx " (tackon @source-dir "extras/CleanupHotlist.rexx") " " (tackon hotdir "aweb.hotlist")))
  205.      )
  206.     )
  207.    )
  208.   )
  209.   (complete 100)
  210.  
  211. ;-------------------------- ... and we gone. -------------------------------
  212.  
  213. (exit (cat #done1 "\""HLHandler_dir"\"" #done2))
  214.  
  215.  
  216.